package org.lxh.demo.vo;

import org.lxh.demo.vo.Person;

public class Student extends Person {
    
	private float score;
	public Student(String id,String name,int age,float score){
		
		super(id,name,age);
		this.setScore(score);
	}
	
	
	public float getScore() {
		return score;
	}


	public void setScore(float score) {
		this.score = score;
	}


	@Override
	public int compareTo(Object arg0) {
		Student stu = (Student)arg0;
		if(this.score < stu.score){
			return -1;
		}else if(this.score > stu.score){
			return 1;
		}else{
			if(super.getAge() < stu.getAge()){
				return -1;
			}else if(super.getAge() > stu.getAge()){
				return 1;
			}else return 0;
			
		}
	}

}
